import Layout from "@/layout/index.vue";
import type { RouteRecordRaw } from "vue-router";
import Demo from "@/views/demo/index.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "root",
    component: Layout,
    redirect: { name: "Demo" },
    children: [
      {
        path: "demo",
        name: "Demo",
        component: Demo,
        meta: {
          title: "主页"
        }
      },
      {
        path: "load-token",
        name: "LoadToken",
        component: () => import("@/components/LoadToken.vue"),
        meta: {
          title: "初始化",
          noCache: true,
          isHomePage: false
        }
      },
      {
        path: "tally-history",
        name: "TallyHistory",
        component: () => import("@/views/tally/TallyHistory.vue"),
        meta: {
          title: "理货历史",
          noCache: true,
          isHomePage: true
        }
      },
      {
        path: "tally-type-select",
        name: "TallyTypeSelect",
        component: () => import("@/views/tally/TallyTypeSelect.vue"),
        meta: {
          title: "选择理货类型",
          noCache: true,
          isHomePage: true
        }
      },
      {
        path: "one-stock-tally",
        name: "OneStockTally",
        component: () => import("@/views/tally/OneStockTally.vue"),
        meta: {
          title: "入库/出库/直接作业",
          noCache: true,
          isHomePage: false
        }
      },
      {
        path: "one-stock-tally-batch",
        name: "OneStockTallyBatch",
        component: () => import("@/views/tally/OneStockTallyBatch.vue"),
        meta: {
          title: "入库/出库/直接作业批量",
          noCache: true,
          isHomePage: false
        }
      },
      {
        path: "two-stock-tally",
        name: "TwoStockTally",
        component: () => import("@/views/tally/TwoStockTally.vue"),
        meta: {
          title: "杂作业/转配",
          noCache: true,
          isHomePage: false
        }
      },
      {
        path: "bulk-tally",
        name: "BulkTally",
        component: () => import("@/views/tally/BulkTally.vue"),
        meta: {
          title: "散货外捣",
          noCache: true,
          isHomePage: false
        }
      },
      {
        path: "login",
        name: "Login",
        component: () => import("@/components/UserLogin/index.vue"),
        meta: {
          title: "denglu",
          noCache: false
        }
      },
      {
        path: "tally-type-select1",
        name: "Test",
        component: () => import("@/views/TallyTypeSelect.vue"),
        meta: {
          title: "主页",
          noCache: true
        }
      },
      {
        path: "retreat-view-select",
        name: "RetreatViewSelect",
        component: () => import("@/views/retreat/RetreatViewSelect.vue"),
        meta: {
          title: "退关",
          noCache: true
        }
      },
      {
        path: "retreat-set",
        name: "RetreatSet",
        component: () => import("@/views/retreat/RetreatSet.vue"),
        meta: {
          title: "退关设置",
          noCache: true
        }
      },
      {
        path: "retreat-set-history",
        name: "RetreatSetHistory",
        component: () => import("@/views/retreat/RetreatSetHistory.vue"),
        meta: {
          title: "退关台账",
          noCache: true
        }
      },
    ]
  }
];

export default routes;
